<template>
  <div class="left-container">
    <h3>Left 组件</h3>
    <h4>状态:{{ $store.getters.allDone }}</h4>
    <hr />
    <p>count 值：{{ $store.state.count }}</p>
    <button class="btn btn-primary" @click="addCount">+1</button>
    <button class="btn btn-primary" @click="maxCount">+N</button>
  </div>
</template>

<script>
export default {
  name: "Left",
  methods: {
    addCount() {
      this.$store.commit("updateCount");
    },
    maxCount() {
      this.$store.commit("manCount", 10);
    },
  },
  created() {
    this.$store.dispatch("getBooks");
  },
};
</script>

<style></style>
